Computer science Lesson Plan
Class: 6th to 8th, Lesson 35.2 : Functions (User-Defined)

Purpose: To teach User-defined functions. Students will learn the use of functions .

No. of Classes

2 classes for 20 students with 5 computers.

Materials Required

Computer, Internet connection.

Prior knowledge

Students should know about directions (Left, Right, forward and backward) and basic programming.

Exercises

Exercise:1



1. Create a function that sends the harvester down a square path to pick a single head of lettuce from the middle of each row.

No Image

Exercise:2



2. Try writing your function again. Is it still helpful? How can you make it work for this puzzle?

No Image

Exercise:3



3. Try to solve this puzzle by creating your own function.

No Image

Exercise:4



4. Use everything that you've learned so far to solve this puzzle in 19 code blocks or less!

No Image

Exercise:5



5. Solve this puzzle in 23 code blocks or less.

No Image

Solutions




Teacher's Instruction
  1. Teachers can help the Students complete these levels if they struggle.
  2. Teachers should give their own creative activity to help children understand per-defined functions.
  3. Teachers can explain the code.org 8th level video if the students are not able to understand either the concept of user-defined functions or the content of the video. (In code.org--> course E--> level-8.).
  4. Sign-in into the code.org before playing the game.